<template>
  <view class="u_parse">
  	<u-parse :content="type == 0 ? userDetail : usePrivacy"></u-parse>
  </view>
</template>

<script>
	import {
		benefitCardUrl
	} from "@/config/tendIdConfig.js";
export default {
  data() {
    return {
      usePrivacy: {},
	  userDetail:{},
	  type:''
    };
  },
  onLoad(op) {
  	this.type = op.type
	console.log(this.type,'this.type??')
	this.getUser();
  },
  methods: {
    getUser() {
		const that = this;
		uni.request({
			url: `${benefitCardUrl}/pageAgreement/getList`,
			method: 'POST',
			data: {
				 pageNum: 1,
				 pageSize: 50,
			},
			success(res) {
				if (res.data.code == 200) {
				  console.log(res, "获取成功");
				  that.userDetail = res.data.data.rows[0].agreementContent 
				  that.usePrivacy = res.data.data.rows[1].agreementContent 
				  console.log(that.usePrivacy, "隐私");
				}
			},
		})
    },
  },
};
</script>

<style>
.u_parse {
		padding: 0 28rpx 32rpx;
	}
	
	.wrapper {
	  white-space: pre-wrap;
	  /* padding: 1rem; */
	}
	.wrapper p {
	  min-height: 1em;
	}
	p {
	    display: block;
	    margin-block-start: 0em;
	    margin-block-end: 0em;
	    margin-inline-start: 0px;
	    margin-inline-end: 0px;
	}
	/* 或者 */
	.wrapper p:empty {
	  height: 1em;
	}
</style>
